﻿using System;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.Metadata.Entity;

namespace T.FAS.Runtime.Metadata.SPI
{
    /// <summary>
    /// 设计时元数据管理接口
    /// </summary>
    public interface IMetaDataManager : 
        IMetaDataReleaseManager, 
        IMetaDataCompiler, 
        IMetaDataSerializer, 
        IMetaDataIdentifier, 
        IMetaDependencyHandler,
        IMetaDataTermHandler
    {
        /// <summary>
        /// 删除元数据
        /// </summary>
        /// <param name="metaData">具体元数据</param>
        void Delete(IMetaDataContent metaData);

        /// <summary>
        /// 更新元数据
        /// </summary>
        /// <param name="metaData">具体元数据</param>
        void Update(IMetaDataContent metaData);

        /// <summary>
        /// 获取具体的元数据
        /// </summary>
        /// <param name="metaDataId">元数据ID</param>        
        /// <returns>具体的元数据</returns>
        IMetaDataContent GetMetaDataContent(string metaDataId);

        ///// <summary>
        ///// 获取组合后元数据内容
        ///// </summary>
        ///// <param name="metaDataContent"></param>
        ///// <returns></returns>
        //IMetaDataContent GetMetaDataContent(IMetaDataContent metaDataContent);

        /// <summary>
        /// 元数据保存
        /// </summary>
        /// <param name="metaData">元数据</param>
        void Save(IMetaDataContent metaData);

        /// <summary>
        /// 合法性校验
        /// </summary>
        /// <param name="metaData">元数据</param>
        ValidateResult Validate(IMetaDataContent metaData);

        /// <summary>
        /// 兼容性校验
        /// </summary>
        /// <param name="metaData">元数据</param>
        /// <param name="oldMetaData">元数据</param>
        ValidateResult CompatibleValidate(IMetaDataContent metaData, IMetaDataContent oldMetaData);

        /// <summary>
        /// 元数据启用时的扩展
        /// </summary>
        /// <param name="metaData"></param>
        /// <param name="releaseStrategy"></param>
        void Release(IMetaDataContent metaData, ReleaseStrategy releaseStrategy);
    }
}
